package com.example.myapplication.item;

import ohos.agp.render.PixelMapHolder;
import ohos.media.image.PixelMap;

import java.util.List;


/**
 * Created by Miaolonglong on 2021/12/24.
 */

public class Mushroom extends ItemSprite {

    public Mushroom(PixelMapHolder bitmap) {
        super(bitmap);
    }

    public Mushroom(int width, int height, List<PixelMapHolder> bitmaps) {
        super(width, height, bitmaps);
    }

    @Override
    public void logic() {
        if (!isDead()&&isVisiable()) {
            if(isJumping()) {
                move(0, mSpeedY++);
            }
            if (isRunning()) {
                if (isMirror()) {
                    //右
                    move(4, 0);
                } else {
                    //左
                    move(-4, 0);
                }
            }

        }
    }
}
